<@pagelet title="小页面左">
<div class="toolbar">
    <div class="btn-group" role="group">
        <button type="button" id="b1" v-on:click="doit" class="btn btn-success">读取页面</button>
    </div>
    <div id="content">{{content}}</div>
    <p>First name: <input data-bind="value: firstName"/></p>
    <p>Last name: <input data-bind="value: lastName"/></p>
    <h2>Hello, <span data-bind="text: fullName"> </span>!</h2>
</div>

<script>
    var a=100;
    console.log(scope);
</script>
<script>
    pagelet(['ko'],function(ko){
        var viewModel = {
            firstName: ko.observable("Planet"),
            lastName: ko.observable("Earth")
        };

        viewModel.fullName = ko.dependentObservable(function () {
            // Knockout tracks dependencies automatically.
            //It knows that fullName depends on firstName and lastName,
            //because these get called when evaluating fullName.
            return viewModel.firstName() + " " + viewModel.lastName();
        });

        ko.applyBindings(viewModel,dom[0]); // This makes Knockout get to work

    });
</script>
</@pagelet>